// 统计数组arr中值等于item的元素出现的次数

const arr = [1, 2, 4, 4, 3, 4, 3]

function count(arr, item) {
    let result = []
    arr.filter(value => {
        return item == value ? result.push(value) : ''
    })
    return result.length
}

console.log(count(arr, 4));